package cn.ilikes.tools.nosql.jpa.query;

import javax.persistence.Parameter;

import cn.ilikes.tools.nosql.jpa.JPASQLNoSupportException;

public class JPASQLParameter<T> implements Parameter<T> {

	private String name;

	private Class<T> parameterType;

	private Integer position = -1;

	private Object value;

	public JPASQLParameter(String name, Class<T> parameterType) {
		super();
		this.name = name;
		//this.position = position;
		this.parameterType = parameterType;
	}

	public Object getValue() {
		return value;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setParameterType(Class<T> parameterType) {
		this.parameterType = parameterType;
	}

	public void setPosition(Integer position) {
		this.position = position;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	@Override
	public String getName() {

		return name;
	}

	@Override
	public Class<T> getParameterType() {

		return parameterType;
	}

	@Override
	public Integer getPosition() {
		throw new JPASQLNoSupportException("this  method  getPosition  not works ");
	}

}
